/**
 * 
 */
package edu.cse5311.constants;

/**
 * @author Karthik Gopalakrishna/ Shwetha Narayan
 *
 */
public class Constants {
	
	//Constants for transaction state
	public static final String ACTIVE = "active";
	public static final String COMMITTED = "committed";
	public static final String BLOCKED = "blocked";
	public static final String ABORTED = "aborted";

	//Constants for Operation type
	public static final String TRANSACTIONAL = "transactional";
	public static final String SYSTEM = "system";
	
	//Constants for Operation name
	//Transactional Operations
	public static final String READ = "r";
	public static final String WRITE = "w";
	public static final String BEGIN = "b";
	public static final String END = "e";
	public static final String COMMIT = "c";
	public static final String ABORT = "a";
	//System Operations
	public static final String CHECKPOINT = "C";
	public static final String FAILURE = "F";
	public static final String FORCE_WRITE = "L";
	public static final String WRITE_I = "W";
	
	//Input and output file paths
	public static final String FILEPATH = "E:\\workspace_DB2\\Recovery\\src\\edu\\cse5311\\";
	public static final String INPUTFILENAME = "Inputfile.txt";
	public static final String OUTPUTFILENAME = "Outputfile.txt";
	
	//Word replace constants
	public static final String TRANSACTION_REPLACE = "#transaction#";
	public static final String ITEM_NAME_REPLACE = "#itemname#";
	public static final String BEFORE_IMAGE_REPLACE = "#BFIM#";
	public static final String ITEM_VALUE_REPLACE = "#itemvalue#";
	public static final String ACTIVE_TRANSACTION_REPLACE = "#activetransaction#";
	public static final String COMMITTED_TRANSACTION_REPLACE = "#committedtransaction#";
	
	//Output Summary lines
	public static final String BEGIN_OPERATION_OUTPUT = "The transaction T#transaction# began it's operation.";
	public static final String END_OPERATION_OUTPUT = "The transaction #transaction# completed it's operation.";
	public static final String COMMIT_OPERATION_OUTPUT = "The transaction #transaction# committed all it's operation.";
	public static final String ABORT_OPERATION_OUTPUT = "The transaction #transaction# is aborted.";
	public static final String ABORT_OPERATION_OUTPUT_RESET = "\tThe item #itemname# is reset to the before image #BFIM#.";
	public static final String READ_OPERATION_OUTPUT = "The transaction #transaction# read the item #itemname#.";
	public static final String READ_OPERATION_FAIL = "\tItem to read/write was not available on the Data Disk.";
	public static final String READ_OPERATION_FROM_CACHE = "\tThe item was read from the data cache/buffer, as it was previously read to the data cache/buffer.";
	public static final String READ_OPERATION_FROM_DISK = "\tThe item was written from the data disk to the data cache/buffer.";
	public static final String WRITE_OPERATION_OUTPUT = "The transaction #transaction# wrote the new value #itemvalue# to the item #itemname#.";
	public static final String FORCEWRITE_OPERATION_OUTPUT = "The forcewrite operation was done.";
	public static final String WRITEOFI_OPERATION_OUTPUT = "The writeOfI operation wrote the datacache item - #itemname# to disk with the value - #itemvalue#.";
	public static final String WRITEOFI_OPERATION_NOT_PERFORMED = "WRITE OF I on this disk is not required as the data has not been modified";
	public static final String DATA_BUFFER_ALLOC_TABLE_ENTRY = "As the data was written to the data buffer a new entry was made in the data buffer allocation table.";
	public static final String WRITE_AHEAD_LOGGING = "WAL: Writing the contents of the Log buffer into the log Disk, before the contents of the Data Buffer being written into the Data Disk.";
	public static final String CHECKPOINT_OUTPUT = "\tThe transaction T#transaction# is active, hence it's data won't be written to the disk";
	public static final String CHECKPOINT_OPERATION_OUTPUT = "\tThe system wrote item #itemname# with the value #itemvalue#, modified by committed transaction T#transaction# to disk.";
	public static final String CACHE_FULL = "The Data Cache is full, please give a different input.";
	//logging operations output lines
	public static final String LOG_BUFFER_FULL = "*****The log buffer is full!! The contents are now being written to the log disk*****";
	public static final String LOG_DISK_WRITE = "*****The log buffer contents were written to the log disk*****";
	
	//output for recovery
	public static final String FAILURE_OPERATION_OUTPUT = "Begin recovery using the log file. Undo/Redo operations after the latest Checkpoint.";
	public static final String FAILURE_OPERATION_OUTPUT_ANALYSIS = "\tBegin the analysis phase of Recovery using the log file.";
	public static final String FAILURE_OPERATION_OUTPUT_ANALYSIS_ACTIVE = "\t\tList of Active Transactions: #activetransaction#";
	public static final String FAILURE_OPERATION_OUTPUT_ANALYSIS_COMMIT = "\t\tList of Committed Transactions: #committedtransaction#";
	public static final String FAILURE_OPERATION_OUTPUT_ANALYSIS_NO_ACTIVE = "\t\tNo transactions to be undone.";
	public static final String FAILURE_OPERATION_OUTPUT_ANALYSIS_NO_COMMITTED = "\t\tNo transactions to be redone.";
	public static final String FAILURE_OPERATION_OUTPUT_UNDO_REDO = "\tBegin the Undo Redo phase of Recovery using the log file.";
	public static final String FAILURE_OPERATION_OUTPUT_UNDO = "\t\tUNDO : The item #itemname#, of transaction #transaction# is reset to the before image value: #itemvalue#";
	public static final String FAILURE_OPERATION_OUTPUT_NO_UNDO = "\\ttUNDO : The item #itemname#, is already undone.";
	public static final String FAILURE_OPERATION_OUTPUT_REDO = "\t\tREDO : The item #itemname#, of transaction #transaction# is reset to the after image value: #itemvalue#.";
	
	//output for internal steps of a function
	public static final String BEGIN_TRANSACTION_TABLE_OUTPUT = "\tAn entry was made in the transaction table for T#transaction# with its status being active.";
	public static final String END_TRANSACTION_TABLE_OUTPUT = "\tThe entry made in the transaction table for T#transaction# was deleted.";
	public static final String COMMIT_TRANSACTION_TABLE_OUTPUT = "\tThe entry in the transaction table for T#transaction# was modified with its status to committed.";
	public static final String WRITE_TRANSACTION_TABLE_OUTPUT = "\tThe entry in the transaction table for T#transaction# was updated with the list of modified items.";
	
	
}
